package com.interf.agv;

import java.io.InputStream;

public class AGVData extends Thread {
	private InputStream inputStream;
	public AGVData(InputStream inputStream) {
		this.inputStream = inputStream;
	}

	public void run() {
		try {
			byte[] bytes = new byte[1024];
			int len;
			while ((len = inputStream.read(bytes)) != -1) {
				//注意指定编码格式，发送方和接收方一定要统一，建议使用UTF-8
				deal(new String(bytes, 0, len, "UTF-8"));
			}
		} catch (Exception e) {
			e.printStackTrace();
			AGVUtil.close();
		}
	}

	/**
	 * 处理AGV数据
	 * @param data
	 */
	private void deal(String data) {

	}
}
